home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / ggraph / ggraphstruct.h < prev    next >
C/C++ Source or Header  |  1989-07-12  |  4KB  |  92 lines

  1. #include "ggraph.h"
  2.  
  3. /****************************************************************
  4.  *    All the structures used globaly by ggraph        *
  5.  *                                *
  6.  ****************************************************************/
  7.  
  8. /* The generic text structure used for all text structures on the graph */
  9. struct gtext{            /* text for the graph */
  10.     int t_type;            /* type of thing this is */
  11.     int t_font;            /* font to use */
  12.     int t_size;            /* size to use */
  13.     int t_just;            /* justification to use */
  14.     float t_xpos;        /* X connection point in user coord */
  15.     float t_ypos;        /* Y connection point in user coord */
  16.     float t_vertsz;        /* vertical size of text in dev coord */
  17.     float t_hortsz;        /* horizontal size of text in dev coord */
  18.     int t_text[80];        /* text string */
  19. };
  20.  
  21. /* The frame structure used for all frames  */
  22. struct frame{            /* a frame for something */
  23.     int    frame_type;        /* what is it for */
  24.     int     fsize;        /* thickness of frame */
  25.     float   frame1x, frame1y;    /* one corner of the frame */
  26.     float   frame2x, frame2y;    /* one corner of the frame */
  27.     float   frame3x, frame3y;    /* one corner of the frame */
  28.     float   frame4x, frame4y;    /* one corner of the frame */
  29. };
  30.  
  31. /* A line on the graph and its properties */
  32. struct aline {
  33.     struct aline *forw_line;/* pointer to next line */
  34.     struct aline *back_line;/* pointer to prev line */
  35.     int     lonoff;        /* is this line visible */
  36.     int     llabsw;        /* line label on/off */
  37.     int     ctype;        /* curve type to use */
  38.     int     ltype;        /* brush type to use */
  39.     int     lthick;        /* brush thickness to use */
  40.     int     lsize;        /* line size to use */
  41.     int     mtype;        /* type of mark for points */
  42.     int     maxpoint;    /* max number of points this line */
  43.     float   maxx, maxy;    /* maximum coordinate values for line */
  44.     float   minx, miny;    /* minimum coordinate values for line */
  45.     float   xpoints[MAXSIZE]; /* X coordinates in user coords */
  46.     float   ypoints[MAXSIZE]; /* Y coordinates in user coords */
  47.     char    lname[20];    /* user name of line */
  48.     struct gtext llabel;    /* line label */
  49.     struct gtext llelabel;    /* line legend label */
  50.     };
  51.  
  52. /* A graph and its properties */
  53. struct agraph{
  54.     struct aline *lines[MAXLINES];
  55.     int     maxlines;        /* number of datasets in plot */
  56.     int     axline_type;    /* type of line for axis */
  57.     int     xgrid_type;        /* type of line for X grid */
  58.     int     ygrid_type;        /* type of line for Y grid */
  59.     int        yvert;        /* should we do vertical chars */
  60.     int        xpreci1, xpreci2;    /* precision for X labels */
  61.     int        ypreci1, ypreci2;    /* precision for Y labels */
  62.     int     maxtickx, maxticky;    /* maximum value of X and Y ticks on axis */
  63.     int     mintickx, minticky;    /* minimum value of X and Y ticks on axis */
  64.     int     numtickx, numticky;    /* count of X and Y ticks on axis */
  65.     float   xplotmax, yplotmax;    /* plot area */
  66.     float   logxtick, logytick;    /* tick factor for log graphs */
  67.     float   xoffset, yoffset;   /* offsets for coordinates */
  68.     float   dtickx, dticky;    /* delta for ticks */
  69.     float   stickx, sticky;    /* starting value for ticks */
  70.     float   scalex, scaley;    /* scaling factor for graph */
  71.     float   xorigin, yorigin;    /* the origin of the graph */
  72.     float   gmaxx, gmaxy;    /* maximum coordinate values for line */
  73.     float   gminx, gminy;    /* minimum coordinate values for line */
  74.     float   xcenter, ycenter;    /* center of each axis */
  75.     float   symbolsz;        /* pixel size for symbols */
  76.     int     gtype;        /* type of graph */
  77.     int     logxsw, logysw;    /* switches for log axis */
  78.     int     firstxsw, firstysw;    /* switches for log axis */
  79.     struct frame gframe;    /* graph frame */
  80.     struct frame lframe;    /* legend frame */
  81.     struct gtext gtitle;    /* title for graph */
  82.     struct gtext xlabel;    /* label for X axi */
  83.     struct gtext ylabel;    /* label for Y axis */
  84.     struct gtext xtick;        /* tick for X axis */
  85.     struct gtext ytick;        /* tick for Y axis */
  86.     struct gtext legend;    /* lengend title */
  87.     int graph_units;            /* type of units graph is specifed in */
  88.     int xaxis_length;        /* length of x axis in inches */
  89.     int yaxis_length;        /* length of y axis in inches */
  90. };
  91.  
  92.